<?php
  include "include/config.inc.php";
  $loanId = $_REQUEST['loanNo'];
  $currentDate = $_REQUEST['currantDate'];
  $checkInterestPanding = "SELECT interestReceivedId
		                         FROM interestreceived
		                        WHERE loanId = ".$loanId."
		                          AND isReceive = 0
		                          AND dateOfInstallment < '".$currentDate."' ";
    $checkInterestPandingRes = mysql_query($checkInterestPanding);
    $checkInterestPandingNumRow = mysql_num_rows($checkInterestPandingRes);
    if($checkInterestPandingNumRow > 0 )
    {
      echo "0";
    }
    else
    {
      echo "1";
    }
?>